package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Book;
import com.example.entity.Params;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: PengFei.He
 * @Date: 2024/11/6 19:50
 * @Function:
 */
@Mapper
public interface BookMapper extends BaseMapper<Book> {
    List<Book> findBySearch(@Param("params") Params params);

    @Select("select book.*, type.name as typeName from book left join type on book.typeId = type.id")
    List<Book> findAll();
}
